KISSY.use("node",function(S,Node){ 
$(".badtool").on("click",function(){
	var toolname = $(this).attr("data-tool");
	showDialog("尚未开通","<div class=\"control-group centered \">亲，您还未开通本工具，请开通后使用。<button class=\"button assigntool\" type=\"button\" >立即开通</button><p class=\"auxiliary-text\"><label class=\"label label-warning\">注意</label>默认可开通一个工具，您发布的所有活动参与人数每增加<span style=\"color:#FF0000\">1000</span>人可开通<span style=\"color:#FF0000\">1</span>个工具。</p></div>","form-horizontal");
	$(".assigntool").on("click",function(){
		KISSY.io({
			"url":"/?m=shop&a=assigntool",
			"data":{"toolname":toolname},
			"success":function(data){
			closeDialog();
				if(data.status==true){
					var dt="开通成功！";
				}else{
					var dt="开通失败。。。";
				}
				showDialog(dt,"<div class=\"control-group centered \">"+data.msg+"</div>","form-horizontal");
			},
			"error":function(){},
			"dataType":"jsonp"
		});
	});
});
$(".tool").on("click",function(){
	$(".tnm").remove();
	var tool = $(this).attr("data-tool");
	var str = '<input type="hidden" class="tnm" name="toolname" value="'+tool+'" />';
	$(str).prependTo("form");
	$(".x-icon-success").remove();
	var str = '<span class="x-icon x-icon-small x-icon-success" style="position:absolute"><i class="icon icon-white icon-ok"></i></span>';
	$(str).prependTo(this);
	
});
$(".button.save").on("click",function(){
	if($(".tnm").val()){
		return true;
	}else{
		showDialog("请选择活动类型","亲，你还么有选择活动类型呢！请选择后继续","form-horizontal");
		return false;
	}
});
});
// SNS.ui("sharebtn",{"type":"webpage","title":"webpage","key":"http://www.taobao.com/go/act/sns/opendocs_sdk.php","client_id":"68","element":"#sns-widget-sharebtn"})